import React, { Component } from 'react'

export default class Event extends Component {
    fn = (state, ev) => {
        console.log('我触发了事件', '我是参数+', state, ev)
    }
    render() {
        return (
            <div>
                {/* 合成事件 */}
                {/* <button onClick={ this.fn }>
                    点我触发
                </button> */}

                {/* this.fn.bind(this)  如果不传参, 参数默认为事件对象  */}
                {/* <button onClick = { this.fn.bind(this) }>
                    点我触发
                </button> */}

                {/* <button onClick={this.fn.bind(this, 123456)}>
                    点我触发
                </button> */}

                {/* <button onClick={() => {
                    this.fn(123)
                }}>
                    点我触发
                </button> */}

                <button onClick={(ev) => {
                    this.fn(123, ev)
                }}>
                    点我触发
                </button>
            </div>
        )
    }
}
